#!/usr/bin/env python
import os
import sys
import django

# 设置Django环境
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dnsadmin.settings')
django.setup()

from django.contrib.auth.models import User

# 创建超级用户
if not User.objects.filter(username='admin').exists():
    User.objects.create_superuser('admin', 'admin@example.com', 'admin123456')
    print('Created admin user: admin/admin123456')
else:
    print('Admin user already exists')